package Year22_Month06.day06;

public class 二叉树的最大深度_DFS {
    public int maxDepth(TreeNode root) {
        int deepth = DFS(root);
        return deepth;
    }

    public int DFS(TreeNode root){
        return root == null ? 0 : Math.max(DFS(root.left),DFS(root.right)) + 1;
    }
}
